<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <title>Emall</title>
    </h:head>

    <h:body>


        <div id="top" class="top">
            E-MALL
        </div>

        <div id="left" style="text-align: center;">
            <c:if test="${userBean.vendeurConnected == false}">
                <a href="#" onclick="(connexion).show();">Se connecter</a><br/>
                <a href="#" onclick="(inscription).show();">S'inscrire</a><br/>
                <h:form>
                    <p:dialog header="Se connecter" widgetVar="connexion" modal="true" height="55" resizable="false">
                        <h:outputText style="float: left; margin-top: 5px;" value="Login :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.login}" title="Login" /><br/><br/>
                        <h:outputText style="float: left; margin-top: 5px;" value="Password :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.password}" title="Password" />
                        <f:facet name="footer">  
                            <p:commandButton icon="ui-icon-check" value="Valider"  action="#{userBean.connexionVendeur()}"/>  
                        </f:facet> 
                    </p:dialog>
                </h:form>
                <h:form>
                    <p:dialog header="S'inscrire" widgetVar="inscription" modal="true" height="205" resizable="false">
                        <h:outputText style="float: left; margin-top: 5px;" value="Nom :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.nom}" title="Nom" /><br/><br/>
                        <h:outputText style="float: left; margin-top: 5px;" value="Prénom :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.prenom}" title="Prénom" /><br/><br/>
                        <h:outputText style="float: left; margin-top: 5px;" value="Adresse :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.adresse}" title="Adresse" /><br/><br/>
                        <h:outputText style="float: left; margin-top: 5px;" value="Magasin :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.magasin}" title="Magasin" /><br/><br/>
                        <h:outputText style="float: left; margin-top: 5px;" value="Description :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.description}" title="Description" /><br/><br/>           
                        <h:outputText style="float: left; margin-top: 5px;" value="Login :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.login}" title="Login" /><br/><br/>
                        <h:outputText style="float: left; margin-top: 5px;" value="Password :" />
                        <h:inputText  style="float: right;" required="true" value="#{userBean.password}" title="Password" />
                        <f:facet name="footer">  
                            <p:commandButton icon="ui-icon-check" value="Valider"  action="#{userBean.inscriptionVendeur()}"/>  
                        </f:facet> 
                    </p:dialog>
                </h:form>
            </c:if>
            <c:if test="${userBean.vendeurConnected == true}">
                Bonjour <b>#{userBean.vendeurConnecte.prenom}</b><br/>
                <h:form>
                    <p:commandButton value="Se deconnecter"  action="#{userBean.deconnexion()}"/>  
                </h:form>
                <br/>
                <p:menu style="width: 100%; padding: 0;"> 
                    <p:menuitem value="Accueil" outcome="vendeur.xhtml" icon="ui-icon-home"/> 
                    <p:menuitem value="Mes produits" outcome="listeProduits.xhtml" icon="ui-icon-search"/>
                    <p:menuitem value="Ajouter un produit" outcome="vendeur_listebay.xhtml" icon="ui-icon-plus" />
                </p:menu> 
            </c:if>
        </div>
        <div id="content" class="left_content">
            <ui:insert name="content"></ui:insert>
        </div>
    </h:body>
</html>
